<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>贪吃蛇</title>
    <style>
        #map {
            width: 800px;
            height: 600px;
            background-color: #ddd;
            border: 1px solid #000;
            box-sizing: border-box;
            position: relative;
        }
    </style>
</head>
<body>
    <div id="map"></div>
    当前分数是: <span id="score">0</span>
    <div>↑↓←→箭头控制方向</div>
    <div>按space空格键可暂停游戏</div>
</body>
</html>
<script src="./food.js"></script>
<script src="./snake.js"></script>
<script src="./game.js"></script>
<script>
    var map = document.querySelector('#map');
    // 用来显示分数
    var scoreTxT = document.querySelector('#score');

    // 创建一个游戏对象，调用游戏对象的start方法进行游戏就可以了
    var game = new Game(map, scoreTxT);
    game.start();

</script>